package person.csx.meeting.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import person.csx.meeting.model.Employee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * @Entity person.csx.meeting.model.Employee
 */
@Mapper
public interface EmployeeMapper extends BaseMapper<Employee> {
    @Select("select * from employee where username = #{username}")
    Employee loadEmpByUsername(String username);

    @Insert("insert into employee (employeename, username, phone, email, status, departmentid, password, role) values (#{employeename}, #{username}, #{phone}, #{email}, #{status}, #{departmentid}, #{password}, #{role})")
    Integer doRegister(Employee employee);


    List<Employee> getAllEmp(Employee employee);

    @Select("select * from employee where status = #{status}")
    List<Employee> getAllEmpStatus(Integer status);
}




